<?php
namespace app\serverfund\model;

use \app\manage\model\BaseModel;

/**
 * 冻结日志的模型层
 * @author adv30 <adv30@126.com> 2017年6月21日9:22:44
 */
class FundFreezeLog extends BaseModel
{
    protected $name = 'fund_freeze_log';
    protected $connection = 'db_config_fund';
    protected $dateFormat = 'Y-m-d H:i:s';
    protected $append = ['status_text','type_text','freeze_status_text'];
    protected $typeText = ['goods'=>'商品', 'certificate'=>'证书', 'order'=>'订单', 'withdraw'=>'提现', 'system'=>'系统', 'certi_change_price'=>'证书改价'];
    protected $freezeStatusText = ['0'=>'未全解冻', '1'=>'已全解冻'];

    public function getTypeTextAttr($value, $data)
    {
        return $this->typeText[$data['type']];
    }

    public function getFreezeStatusTextAttr($value, $data)
    {
        return $this->freezeStatusText[$data['freeze_status']];
    }

    public function getUserInfoAttr($value)
    {
        return json_decode($value, true);
    }
   
    public function getOppositeInfoAttr($value)
    {
        return json_decode($value, true);
    }

    
}
